<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<input type="buttom" value="按钮" onclick="f1()">

<script>
    /*1 无参无返回值*/
    function f1(){
        /*输出控制台*/
        console.log("f1");
    }
    /*调用方法*/
    f1();
    /*2 有参无返回值*/
    function f2(name,age){
        console.log(name+":"+age);
    }
    f2("孙尚香",50);
    /*3 无参有返回值*/
    function f3(){
        return "返回值";
    }
    /*let info = f3();*/
    console.log(f3());
    /*4 有参有返回值*/
    function f4(x,y){
        return x*y;
    }
    console.log(f4(6,8));
    /*第二种声明的方式*/
    let f5 = function (name,age){
        console.log(name+":"+age);
    }
    f5(刘备,25);
    /*第三种声明方法的方式*/
    let f6 = new Function("name","age","console.log(name+':'+age");
    f6("吕布",66);
</script>
</body>
</html>